package com.xuan.yrmanage.common.response;


/**
 * Created by admin on 2020/2/26
 */

public enum CommonCode implements ResultCode{

    SUCCESS(true,10000,"操作成功！"),
    FAIL(false,11111,"操作失败！"),

    USER_NAME_OR_PASSWORD_ERROR(false,22222,"账号或密码错误"),
    USER_NOT_EXIST(false,33333,"用户不存在"),
    PASSWORD_ERROR(false,44444,"密码错误"),
    USER_NAME_OR_PASSWORD_IS_EMPTY(false,55555,"账号或密码为空"),

    SERVER_ERROR(false,99999,"抱歉，系统繁忙，请稍后重试！"),
    UNAUTHENTICATED(false,10001,"用户未登录！"),
    UNAUTHORISE(false,10002,"权限不足，无权操作！"),
    INVALID_PARAM(false,10003,"非法参数！"),
    REQUEST_METHOD_NOT_SUPPORT(false,10004,"请求方式错误"),
    AUTHORITY_PARAM_MISS(false,10005,"权限参数缺失，无法操作！"),
    USERID_PARAM_MISS(false,10006,"缺少请求参数:userID ！"),
    USERTYPE_PARAM_MISS(false,10007,"缺少请求参数:userType"),
    STUDENT_NOT_LOGIN(false,10008,"学生不能登录后台"),
    FILE_SIZE_MAX(false,10009,"zip文件大小不能超过20M");




    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;

    //构造函数
    private CommonCode(boolean success, int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }
    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }


}
